<template>
  <div class="app-container">
    <header class="app-header">
      <div class="logo-container">
        <div class="app-logo">🤖</div>
        <h1 class="app-title">AI 智能对话助手</h1>
      </div>
      <div class="header-right">
        <div class="app-version">v1.1.0</div>
        <UserAvatar class="user-avatar" />
      </div>
    </header>
    
    <main class="app-main">
      <ChatBox />
    </main>
    
    <footer class="app-footer">
      <p>© {{ new Date().getFullYear() }} AI 智能对话助手 | 基于大语言模型技术构建</p>
      <div class="footer-links">
        <a href="#" class="footer-link">帮助</a>
        <a href="#" class="footer-link">关于</a>
        <a href="#" class="footer-link">隐私政策</a>
      </div>
    </footer>
  </div>
</template>

<script setup>
import ChatBox from "./components/ChatBox.vue";
import UserAvatar from "./components/UserAvatar.vue";
</script>

<style>
:root {
  --primary-color: #1890ff;
  --primary-hover: #40a9ff;
  --error-color: #ff4d4f;
  --warning-color: #faad14;
  --success-color: #52c41a;
  --border-radius: 8px;
  --box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  --text-color: #333;
  --text-secondary: #666;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --border-color: #eaeaea;
  --header-height: 64px;
  --footer-height: 50px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.5;
}

body[data-theme="dark"] {
  --bg-color: #121212;
  --card-bg: #1f1f1f;
  --text-color: #e2e8f0;
  --text-secondary: #a0aec0;
  --border-color: #333;
  --box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

body[data-theme="blue"] {
  --bg-color: #f0f8ff;
  --card-bg: #f8fcff;
  --primary-color: #0050b3;
  --primary-hover: #096dd9;
  --border-color: #d6e4ff;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.app-header {
  height: var(--header-height);
  background-color: var(--card-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
}

.app-logo {
  font-size: 28px;
  margin-right: 12px;
  animation: pulse 3s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.app-title {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-version {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background-color: rgba(0, 0, 0, 0.06);
  padding: 2px 8px;
  border-radius: 12px;
}

.user-avatar {
  cursor: pointer;
}

.app-main {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.app-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  height: var(--footer-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-link {
  color: var(--primary-color);
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app-header {
    padding: 0 16px;
  }
  
  .app-title {
    font-size: 1.2rem;
  }
  
  .app-main {
    padding: 16px 8px;
  }
  
  .app-footer {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    height: auto;
  }
}
</style>
